-
-
Notifications
You must be signed in to change notification settings - Fork 30
New: rule prefer-replace-text #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/rules/prefer-replace-range.md
Outdated
create(context) { | ||
context.report({ | ||
fix(fixer) { | ||
// error, can be writen: return fixer.replaceText([node, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: the word "written" is spelled incorrectly here. Also, the comment here is missing a ]
.
lib/rules/prefer-replace-text.js
Outdated
|
||
create (context) { | ||
const sourceCode = context.getSourceCode(); | ||
const message = 'prefer using replaceText instead of replaceTextRange.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I think it would be better to make the message:
const message = 'Use replaceText instead of replaceTextRange.';
No description provided.